<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%deal}}".
 *
 * @property string $id
 * @property integer $ad_network_id
 * @property string $ad_network_deal_id
 * @property integer $advertiser_id
 * @property string $name
 * @property string $domain
 * @property string $start_date
 * @property string $end_date
 * @property string $cpm
 * @property integer $status
 * @property string $last_update
 */
class Deal extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%deal}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ad_network_id', 'advertiser_id', 'status'], 'integer'],
            [['ad_network_deal_id', 'start_date'], 'required'],
            [['start_date', 'end_date', 'last_update'], 'safe'],
            [['cpm'], 'number'],
            [['ad_network_deal_id', 'name'], 'string', 'max' => 128],
            [['domain'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'ad_network_id' => 'Ad Network ID',
            'ad_network_deal_id' => 'Ad Network Deal ID',
            'advertiser_id' => 'Advertiser ID',
            'name' => 'Name',
            'domain' => 'Domain',
            'start_date' => 'Start Date',
            'end_date' => 'End Date',
            'cpm' => 'Cpm',
            'status' => 'Status',
            'last_update' => 'Last Update',
        ];
    }
}
